Repository navigation
Conversation
cancelIdleCycle stopped the timers but never closed the screensaver terminal it had launched, so enabling Stay Awake mid-cycle left the screensaver up with no lock pending. Close the screensaver window when a cycle that launched it is cancelled.
|
The previous change closed the screensaver with a pattern match, which also killed a screensaver the user started by hand, and it missed a window that opened after the cancel while the launcher was still starting. Track the windows each cycle opens and close them by address. A window that opens after a cancel during an in-flight launch is closed on arrival. Ownership and address handling live in IdleModel.js so the cases are covered by Node tests.
|
Addressed the three review findings in 9ef46a6:
Still needs a live check on a real session (Stay Awake during an idle screensaver, a hand-started screensaver during idle, and multi-monitor). I'll run those and report back. |
A cancel during launch closed any screensaver window that opened in the next few seconds, including one the user started by hand. Only one window per screen can belong to the cancelled launch, so cap the late closes at the number of screens the launch has not yet filled. Also expose the owned windows and late-close state in idle status for debugging.
A repeated openwindow event for a window the cycle already owned was counted as a late window, spending a late-close slot on a window that was closing anyway.
|
Pushed two commits for the latest findings:
What's verified and what isn't:
I've noted a separate race in |
The budget used the screen count at cancel time, so a monitor dropping out during the launch could shrink it to zero and leave a still-opening window behind. Record the screen count when the launch starts instead.
|
Pushed The late-close budget was sized from the screen count at cancel time, so a monitor dropping out mid-launch could shrink it to zero. The screen count is now recorded when the launch starts ( |
|
I test-merged this onto current The base source path confirms #14256: Focused results:
I also modeled the late-window sequence and reproduced both currently unresolved review concerns:
So the reported bug and ordinary cancellation fix are confirmed, but I would resolve or explicitly accept those two late-window ownership races before merging. I did not run a graphical test on the live desktop. |
A monitor connecting mid-launch can make the launcher open for more screens than were counted at launch, and a monitor dropping out shrinks the count at cancel. Use the larger of the two so neither case leaves a window open.
|
Pushed The late-close budget now uses the larger of the screen count recorded at launch and the screen count at cancel. A monitor that connects after the launch starts is counted by the cancel-time count, and a monitor that drops out is still covered by the launch-time count. Node tests and |
|
@greptileai could you re-review the latest commit, |
|
Thanks @aholbreich for test-merging and for the two race write-ups. Both are now listed as known limitations in the PR body:
Both need a hand-started screensaver or a monitor change within the same few seconds as a cancel. I'd rather state these openly than fix them with an unverified mechanism here. Your test results (39/39 idle, 6/6 workspace) match what I see on my side. Happy to adjust if you'd prefer the other trade-off. |
chessing234
left a comment
There was a problem hiding this comment.
Reviewed head b62c00ebb6460b3a3a0fa70387805fa65fa1f2ac.
Reviewed window-address normalization, owned-window tracking, late-window budgeting, and the serialized close queue. The isolated idle model test passed. No additional reproducible defect found in those model paths. Ownership is inferred from launch timing rather than a launch token; the existing manual-launch overlap concern still needs a live integration reproduction.
|
Thanks. The reported bug is the ordinary cancel path, and that's covered. The two leftover races need a monitor plug or a hand-started screensaver in the same few seconds as a cancel; listing them as known limitations is the right trade-off. I wouldn't block merge on an unverified launch tag. |
|
Thanks @aholbreich, agreed on the trade-off. One data point from a live run, in case it's useful for the merge decision: the manual-overlap race is currently hard to reach. A hand-started screensaver launched during an idle cycle was refused by |
|
Thanks for the detailed write-up and the follow-ups on each review round. This pull request hasn't been classified yet, so it has no label and wasn't tested on a worker in this pass. Classifying an item takes two models agreeing on what it is. I read it as a bug fix for #14256: Next, it goes back in the queue to be classified with the second model, then verified on a worker built from the Omarchy ISO. There's nothing you need to do for now. |
Fixes #14256 — the screensaver outlives its idle cycle.
Problem
cancelIdleCycle()inshell/plugins/services/idle/Service.qmlstops the screensaver and lock timers and runsomarchy-system-wake, but never closes the screensaver terminal. The screensaver is started byomarchy-launch-screensaverthroughhypr_exec, so the cycle does not own that process.Reproduced from the journal: an idle cycle launched the screensaver at 12:30:23, and Stay Awake was enabled at 12:30:24, cancelling the cycle. The window stayed up until the next keypress, and no lock ran.
Change
openwindowevents, by address. A window started by hand is never recorded, because the launcher exits without opening a window when one is already running.hl.dsp.window.close({ window = "address:0x…" }), the same formomarchy-hyprland-window-close-alluses.IdleModel.js, with Node tests.Testing
Node tests:
test/shell.d/idle-test.shpasses, covering address normalization, owned and unowned windows, closed windows, the generated close command, and the late-close cap.Live, on two monitors, against the patched service:
Not yet verified live: a late-close window that opens after a cancel during launch, and a hand-started screensaver launched right after that. Node tests cover the cap arithmetic, but not the timing.
Known limitations of the late-close path:
Both need a hand-started screensaver or a monitor change within the same few seconds as a cancel. The failure is a screensaver staying up until a keypress.
Also not changed here: the launcher's "already running" check can see a screensaver process still closing after a close, and refuse a quick relaunch. It is a race in
omarchy-launch-screensaver, separate from this change.test/shell.d/runtime-smoke-test.shfails one assertion (IPC handler registered once per screen). The same failure occurs onupstream/quattrowithout this change, so it appears to depend on the host's screen setup.🤖 Generated with Claude Code